package com.education.dao;

import com.education.pojo.Admin;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface AdminMapper {
    int deleteByPrimaryKey(Integer aId);

    int insert(Admin record);

    int insertSelective(Admin record);

    Admin selectByPrimaryKey(Integer aId);

    int updateByPrimaryKeySelective(Admin record);

    int updateByPrimaryKey(Admin record);

    Admin selectByUsernamePwd(@Param("username") String username, @Param("password") String password);

    Integer selectByAdminTotal(@Param("roleId") Integer roleId);

    Integer selectByToday(@Param("yesterday") Date yesterday, @Param("today") Date today);

    Integer selectByWeek(@Param("monday") Date monday, @Param("sunday") Date sunday);

    Integer selectByMonth(@Param("firstDay") Date firstDay, @Param("lastDay") Date lastDay);

    Admin selectByUsername(@Param("aUsername") String aUsername);

    List<Admin> selectAll();

    List<Admin> selectDeleted();

    List<Admin> selectAllByDeleted();

    List<Admin> selectByTime(@Param("dateMin") Date dateMin,
                             @Param("dateMax") Date dateMax,
                             @Param("adminName") String adminName);


    String selectByUsernameValid(@Param("username") String username);

    Integer deleteByIdArray(List<Integer> idList);

    int updateById(@Param("id") Integer id, @Param("state") Integer state);

    Integer updateByDeleted(@Param("id") Integer id, @Param("deleted") Integer deleted);

    List<Admin> selectByRoleId(@Param("roleId") Integer roleId);

    int deleteAdminByStateId(@Param("adminId") Integer adminId);

    int selectValidByAdminId(@Param("adminId") Integer adminId);

    Integer deleteAdminById(@Param("id") Integer id);


}